import cn from "classnames";
import React from "react";
import cls from "./ActionBtn.module.scss";

type Props = {
  onClick?: () => void;
  children?: React.ReactNode;
  active?: boolean;
  disabled?: boolean;
};

export const ActionBtn: React.FC<Props> = ({
  onClick,
  children,
  active,
  disabled,
}) => {
  const classes = cn(cls.root, {
    [cls.root_active]: active,
  });

  return (
    <button
      className={classes}
      type="button"
      onClick={onClick}
      disabled={disabled}
    >
      <div className={cls.icon}>{children}</div>
    </button>
  );
};
